package com.compass.ui.client;

import com.extjs.gxt.ui.client.util.Margins;
import com.extjs.gxt.ui.client.util.Padding;
import com.extjs.gxt.ui.client.widget.ContentPanel;
import com.extjs.gxt.ui.client.widget.LayoutContainer;
import com.extjs.gxt.ui.client.widget.layout.HBoxLayout;
import com.extjs.gxt.ui.client.widget.layout.HBoxLayout.HBoxLayoutAlign;
import com.extjs.gxt.ui.client.widget.layout.HBoxLayoutData;
import com.google.gwt.user.client.Random;

public class IndicBar extends ContentPanel
{

	public IndicBar(int nb)
	{
		super();
		setHeaderVisible(false);
		setBorders(false);
		HBoxLayout layout = new HBoxLayout();
		layout.setHBoxLayoutAlign(HBoxLayoutAlign.MIDDLE);
		setLayout(layout);
		while (nb > 0)
		{
			int i = Random.nextInt(4);
			String str = "";
			switch (i) {
			case 0:
				str = "Qualité";
				break;
			case 1:
				str = "Couts";
				break;
			case 2:
				str = "Délais";
				break;
			case 3:
				str = "Prestations";
				break;
			default:
				break;
			}
			IndicPanel panel = new IndicPanel(str);
			panel.setWidth("100px");
			add(panel);
			nb--;
		}
	}
}
